package com.dch.calculator.exceptions;

import android.app.Activity;

public class CalculatorException extends Exception {

    private String title;
    private String place;
    private String message;

    public CalculatorException(final String detailMessage, final Throwable throwable, final String title, final String place, final String message) {
        super(detailMessage, throwable);
        this.title = title;
        this.place = place;
        this.message = message;
    }

    public CalculatorException(final Activity activity, final Throwable cause) {
        this(cause.getMessage(), cause, null, activity.getClass().getSimpleName(), cause.getMessage());
    }

    public CalculatorException(final String detailMessage) {
        this(detailMessage, null, null, null, null);
    }

    public CalculatorException(final String detailMessage, final Throwable throwable) {
        this(detailMessage, throwable, null, null, null);
    }

    public CalculatorException(final String detailMessage, final String message) {
        this(detailMessage, null, null, null, message);
    }

    public String getTitle() {
        return title;
    }

    public String getPlace() {
        return place;
    }

    public String getMessage() {
        return message;
    }
}
